<?php

namespace Payment\Common\SwThree\Data;


/**
 * Class BackPubChargeData
 *  小程序数据也在这里处理
 * @property string $device_info   设备号
 * @property string $trade_type  交易类型
 * @property string $prepay_id   预支付交易会话标识
 *
 * @package Payment\Common\Sw\Data
 *
 */
class BackPubChargeData extends SwBaseData
{
    public function getData()
    {
        $data = [];
        switch ($this->pay_type) {
            case '010':
                { //微信
                    $data = [
                        'appId' => $this->appId,
                        'timeStamp' => $this->timeStamp,
                        'nonceStr' => $this->nonceStr,
                        'package' => $this->package_str,
                        'signType' => $this->signType, // 签名算法，暂支持MD5
                        'paySign' => $this->paySign
                    ];

                    break;
                }

            case '020':
                { //支付宝
                    $data = [
                        'ali_trade_no' => $this->ali_trade_no,
                    ];

                    break;
                }
            case '060':
                {
                    $data = [
                        'token_id' => $this->token_id,
                    ];

                    break;
                }
        }
        $this->retData['jspackage'] = $data;
        $this->retData['other'] = [
            'out_trade_no' => $this->out_trade_no
        ];

        return parent::getData(); // TODO: Change the autogenerated stub
    }


    protected function buildData()
    {

    }

    protected function checkDataParam()
    {
        // 不进行检查
    }
}
